package com.cskaoyan.service;

import com.cskaoyan.bean.*;
import com.cskaoyan.bean.vo.AdminDashboardVO;
import com.cskaoyan.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author heyyon
 * 首页
 */
@Service
public class AdminDashboardServiceImpl implements AdminDashboardService{
    @Autowired
    AdminMapper adminMapper;
    @Autowired
    GoodsMapper goodsMapper;
    @Autowired
    OrderMapper orderMapper;
    @Autowired
    GoodsProductMapper goodsProductMapper;
    @Override
    public AdminDashboardVO adminDashboardInfo() {
        return new AdminDashboardVO(goodsMapper.countByExample(new GoodsExample()), adminMapper.countByExample(new AdminExample()),
                goodsProductMapper.countByExample(new GoodsProductExample()), orderMapper.countByExample(new OrderExample()));
    }
}
